{template 'web/common/common'}
{template 'webapp/webappSet/navbar'}
<link rel="stylesheet" type="text/css" href="../addons/kundian_farm/resource/css/layui.css" />
<style>
    body{background: white;}
    .layui-form-label{width: 110px;}
</style>
<blockquote class="layui-elem-quote layui-text">
    轮播图新增/编辑
</blockquote>
<div class="panel-body" id="app">
    <form class="layui-form" action="{url 'site/entry/webapp',array('m'=>'kundian_farm','op'=>'slide_set_edit_save','version_id'=>$_GPC['version_id'])}" method="post">
        <div class="layui-form-item">
            <label class="layui-form-label">轮播图图片（1900*900）</label>
            <div class="layui-input-block">
                {php echo tpl_form_field_image('slide_src',$list['slide_src']);}
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">开关-默认开</label>
            <div class="layui-input-block">
                {if $list['status']==1}
                <input type="checkbox" checked="" name="status" value="1" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
                {else}
                <input type="checkbox" name="status" value="1" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
                {/if}
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-inline">
                <input type="number" name="rank"  value="{$list['rank']}" placeholder="排序" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <input type="hidden" name="id" value="{$list['id']}">
                <button class="layui-btn" type="submit">立即提交</button>
                <button class="layui-btn layui-btn-primary" type="reset">重置</button>
                <a href="{url 'site/entry/webapp',array('m'=>'kundian_farm','op'=>'slide_set','version_id'=>$_GPC['version_id'])}">
                    <button type="button" class="layui-btn layui-btn-primary">返回</button>
                </a>
            </div>
        </div>
    </form>
</div>
<script src="../addons/kundian_farm/resource/layui.js" charset="utf-8"></script>
<!--<script src="../addons/kundian_farm/resource/lay/modules/form.js" charset="utf-8"></script>-->
<script>
    layui.use(['form', 'layedit', 'laydate'], function(){
        //监听指定开关
        form.on('switch(switchTest)', function(data){
            layer.msg('开关checked：'+ (this.checked ? 'true' : 'false'), {
                offset: '6px'
            });
        });

    });
</script>